<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\UserSupplierSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户供货单位';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-supplier-index">
    <br>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('创建供货单位', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'id',
            'user_id',
            [
                'attribute'=>'user_id',
                'label'=>'用户名称',
                'value'=>"user.name",
            ],
            'name',
            ['class' => 'yii\grid\ActionColumn'],
        ],
        'emptyText'=>'当前没有用户',
        'emptyTextOptions'=>['style'=>'color:red;font-weight:bold'],
        'layout'=>"{items}\n{pager}",
    ]); ?>
</div>
